use strict;
use warnings;

package JasPerl::JSTL::Core::OtherwiseTag;
use parent qw(JasPerl::JSTL::Core::ConditionalTagSupport);

use JasPerl::Exceptions;

my $PARENT_CLASS = 'JasPerl::JSTL::Core::ChooseTag';

sub condition {
    my $self = shift;
    my $parent = $self->find_ancestor_isa($PARENT_CLASS)
        or JasPerl::JSTL::Core::Exception->throw('OTHERWISE_OUTSIDE_CHOOSE');
    return !$parent->done();
}

1;
